package cn.book.entity;
//分页工具类
public class Page {
    private Integer currPageNo;  //当前页码
    private Integer pageSize;  //每页显示的页数
    private Integer totalCount;  //总记录数
    private Integer totalPageSize; //总的页数

    public Integer getCurrPageNo() {
        return currPageNo;
    }

    public void setCurrPageNo(Integer currPageNo) {
        this.currPageNo = currPageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        if (totalCount > 0) {
            this.totalCount = totalCount;
        }
        this.totalPageSize = this.totalCount % pageSize == 0 ?
                this.totalCount / this.pageSize : this.totalCount / this.pageSize + 1;
    }

    public Integer getTotalPageSize() {
        return totalPageSize;
    }

    public void setTotalPageSize(Integer totalPageSize) {
        this.totalPageSize = totalPageSize;
    }
}
